' This App demonstrates the BASICS of using CARDS.DLL in VB
' This is by NO MEANS a finished, polished product and as
' such, the author releases this code to the public domain
' but releases himself from any damage or misuse that may
' arise from the use of this product.
' CARDS.DLL is Copyright Microsoft Corporation and this
' program does NOT give you permission to distribute that
' file with your own applications.
'Structures to use in Sample App
Type tagPOINT
x As Integer
y As Integer
End Type
Type tagCARD
CardFace As Integer 'Card # 1-52
FaceType As Integer 'BOOL Faceup True False
pt As tagPOINT 'Upper Left Hand corner of card
End Type
Global Card As tagCARD
'Function Declarations for CARDS.DLL
Declare Function CardInit Lib "CARDS.DLL" Alias "cdtInit" (PointX As Integer, PointY As Integer) As Integer
' Pointers to Card coordinates, returns TRUE if succesful
Declare Function DrawCard Lib "CARDS.DLL" Alias "cdtDraw" (ByVal hDC As Integer, ByVal PointX As Integer, ByVal PointY As Integer, ByVal Card As Integer, ByVal DrawMode As Integer, ByVal BkGrnd As Long) As Integer
'Parameters:
'hDC- HDC of window to draw cards on
'x,y - Upper left hand point
'Card - Card # (Use CONSTANTS)
'Mode- Draw Mode for Card, see Constants
'BkGrnd- An RBG Long value of the Background color for the drawn card
'RETURNS TRUE IF SUCCESSFUL
Declare Function DrawCardEX Lib "CARDS.DLL" Alias "cdtDrawExt" (ByVal hDC As Integer, ByVal PointX As Integer, ByVal PointY As Integer, ByVal ExtX As Integer, ByVal ExtY As Integer, ByVal Card As Integer, ByVal DrawMode As Integer, ByVal BkGrnd As Long) As Integer
' Extended drawing fuction, allows for nonstandard card sizes.
'Same params as above plus:
'ExtX, ExtY- Lower right hand corner of Card, used to stretch or shrink Cards to specific sizes
'RETURNS TRUE IF SUCCESSFUL
Declare Sub EndCard Lib "CARDS.DLL" Alias "cdtTerm" ()
'Call when you are finshed with the DLL.
Global Center As tagPOINT
Global Const IDACLUBS = 0
Global Const ID2CLUBS = 4
Global Const ID3CLUBS = 8
Global Const ID4CLUBS = 12
Global Const ID5CLUBS = 16
Global Const ID6CLUBS = 20
Global Const ID7CLUBS = 24
Global Const ID8CLUBS = 28
Global Const ID9CLUBS = 32
Global Const ID10CLUBS = 36
Global Const IDJCLUBS = 40
Global Const IDQCLUBS = 44
Global Const IDKCLUBS = 48
Global Const IDADIAMONDS = 1
Global Const ID2DIAMONDS = 5
Global Const ID3DIAMONDS = 9
Global Const ID4DIAMONDS = 13
Global Const ID5DIAMONDS = 17
Global Const ID6DIAMONDS = 21
Global Const ID7DIAMONDS = 25
Global Const ID8DIAMONDS = 29
Global Const ID9DIAMONDS = 33
Global Const ID10DIAMONDS = 37
Global Const IDJDIAMONDS = 41
Global Const IDQDIAMONDS = 45
Global Const IDKDIAMONDS = 49
Global Const IDAHEARTS = 2
Global Const ID2HEARTS = 6
Global Const ID3HEARTS = 10
Global Const ID4HEARTS = 14
Global Const ID5HEARTS = 18
Global Const ID6HEARTS = 22
Global Const ID7HEARTS = 26
Global Const ID8HEARTS = 30
Global Const ID9HEARTS = 34
Global Const IDTHEARTS = 38
Global Const IDJHEARTS = 42
Global Const IDQHEARTS = 46
Global Const IDKHEARTS = 50
Global Const IDASPADES = 3
Global Const ID2SPADES = 7
Global Const ID3SPADES = 11
Global Const ID4SPADES = 15
Global Const ID5SPADES = 19
Global Const ID6SPADES = 23
Global Const ID7SPADES = 27
Global Const ID8SPADES = 31
Global Const ID9SPADES = 35
Global Const IDTSPADES = 39
Global Const IDJSPADES = 43
Global Const IDQSPADES = 47
Global Const IDKSPADES = 51
Global Const IDGHOST = 53
' To see Card backs, you must use FACEDOWN in the call, rather than FACEUP